<?php
/**
 * CreateTime: 2023/11/15 10:17
 * User:LinQ
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('address', function (Blueprint $table) {
            // 数据库基本配置
            $table->engine = 'InnoDB';
            // 数据库字段
            $table->id('address_id')->comment("商品id");
            $table->integer('customer_id')->nullable(false)->comment("顾客id");
            $table->string('recipient_name')->nullable(false)->comment("收件人姓名");
            $table->string('phone_number')->nullable(false)->comment("联系手机号");
            $table->string('city')->nullable(false)->comment("城市");
            $table->string('state')->nullable(false)->comment("省");
            $table->string('address_line')->nullable(false)->comment("详细地址");
            $table->string('postal_code')->nullable(false)->comment("邮政编码");
            $table->integer('status')->nullable(false)->comment("基础状态");
            $table->integer('is_default')->default(2)->nullable(false)->comment("是否默认 1是 2否");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
};
